#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<malloc.h>
int judgment(int n) {
    int tmp = n;
    while (tmp)
    {
        int i = tmp % 10;
        if (i == 0 || n % i != 0)
            return 0;
        tmp /= 10;
    }
    return 1;
}
int main()
{
    int left = 0;
    int right = 0;
    scanf("%d %d", &left, &right);
    int* arr = (int*)malloc(sizeof(int) * (right - left + 1));
     int count = 0;
    
        for (int i = left;i <= right;i++)
        {
            int ret = judgment(i);
            if (ret == 1)
            {
                arr[count++] = i;
            }
        }
        for (int i = 0;i < count;i++)
        {
            printf("%d ", arr[i]);
        }
        return 0;
}


